Arithmetic coding is a technology capable of reversibly compressing the quantity of information up to a theoretical limit depending on the occurrence probability of information source symbols. Arithmetic coding is applied, in the image coding fields, to JPEG2000 standard (ISO/IEC15444), H.264/MPEG4-AVC standard (see, for example, non-patent document 1), and others.
For example, in H.264, Context Adaptive Binary Arithmetic Coding (CABAC) is applied, and coding of high efficiency is realized depending on the probability characteristic of syntax.
Context Adaptive Binary Arithmetic Coding in H.264 is explained. FIG. 9 shows a conventional context adaptive binary arithmetic coding circuit.
In a context adaptive binary arithmetic coding circuit 14 in FIG. 9, a binarizing circuit 130 binarizes multivalued input data composed of conversion coefficient data, flags and other coding information. Binarization is performed by judging the syntax element showing the type of the input data from the control information, and using properly a plurality of methods such as an unary binarization and a fixed-length binarization depending on the data probability characteristic. Binary symbol (binary) sequences binarized by the binarizing circuit 130 are entered into a (binary) arithmetic coding circuit 140.
A context calculation circuit 520 determines uniformly the value of context index (ctxIdx) used in coding of present 1 bit in the binary symbol sequence on the basis of the control information showing the syntax element, by referring to a table determined in the H.264 standard. The context calculation circuit 520 initializes and stores occurrence probability information in every value of ctxIdx. The occurrence probability information is a set of MPS showing the symbol of the higher occurrence probability of binary symbol 0 or 1 and occurrence probability pState. The occurrence probability information corresponding to the determined ctxIdx value is called the “context information”.
The context calculation circuit 520 generates context information 504, and outputs it to the arithmetic coding circuit 140. Thus, depending on the syntax element for arithmetic coding, the symbol occurrence probability or the context information 504 to be entered in the arithmetic coding circuit 140 is changed over adaptively, and the optimum arithmetic coding become possible for the binary symbol sequence 503 in which the occurrence probability of a binary symbol is changed dynamically.
In the following explanation, the total bit length (symbol length) of binary symbol sequence is called the “symbol amount”, and the total bit length of output code after arithmetic coding is called the “code amount”, and in particular, the total bit length of binary symbol sequence generated when multivalued input data of a specific section is processed is called the “generated binary symbol amount”, and the total bit length of output codes is called the “generated code amount”.
The operation of the arithmetic coding circuit 140 is explained by referring to FIGS. 10A and 10B. In FIGS. 10R and 10B, suppose that the binary sequence of {0,0.0,1} are supplied from the information source of which the occurrence probability of symbol “0” is 0.75 (0.11 in binary notation), and the occurrence probability of symbol “1” is 0.25. In this case, the present context information 504 is expressed by MPS showing the symbol of higher occurrence probability=0, and occurrence probability pState=0.11 (see FIG. 10A). Indeed, the occurrence probability pState is expressed by a normalized integer value, but a binary value is used herein for the sake of simplicity. The context information 504 is updated by this binary arithmetic coding, and is returned to the context calculation circuit 520. In the context calculation circuit 520, the occurrence probability information of the corresponding ctxIdx is updated. This value is utilized again in the next coding process of the same context.
Referring now to FIG. 10B, when a first input binary value “0” is entered, the section of [0, 1] is narrowed to the 0 side divided by probability 0.11, and becomes [0, 0.11]. When a second input “0” is entered, the section of [0, 0.11] is narrowed to [0, 0.1001]. Herein, 0.1001=0.11×0.11. Similarly, by a third input “0”, the section becomes [0, 0.011011]. When a fourth input “1” is entered, the section is narrowed to the 1 side. The final section is [0.01010001, 0.011011]. Of the values contained in this final section, the one having the shortest word length is the code word. That is, since 0.011 is contained in this section, the value “011” below the decimal point is an output binary sequence, and the four-bit input value is compressed to 3 bits. Actually, on the moment of establishment of output bit (0 or 1), the process called renormalization for left-bit shift of probability value is executed.
On the other hand, in moving image coding, in order to maxdiize the image quality in specific bit rate condition, it is necessary to control the code amount by appropriately controlling the quantization parameters when coding each macro block. To enhance the precision of control of code amount, it is general to code repeatedly by changing the parameters in the unit of slice, frame, or GOP (group of pictures).
Patent document 1: JP-A-2004-135251
Non-patent document 1: ISO/IEC14496-10 Advanced video coding for generic audiovisual services